﻿using System;
using System.Collections.Generic;
namespace JSShop.Model
{
	/// <summary>
	/// Hishop_SKUs:实体类(属性说明自动提取数据库字段的描述信息)
	/// </summary>
	[Serializable]
	public partial class Hishop_SKUs
	{
		public Hishop_SKUs()
		{}
		#region Model
		private string _skuid;
		private int _productid;
		private string _sku;
		private decimal? _weight;
		private int _stock;
		private decimal? _costprice;
		private decimal _saleprice;
		/// <summary>
		/// 
		/// </summary>
		public string SkuId
		{
			set{ _skuid=value;}
			get{return _skuid;}
		}
		/// <summary>
		/// 
		/// </summary>
		public int ProductId
		{
			set{ _productid=value;}
			get{return _productid;}
		}
		/// <summary>
		/// 
		/// </summary>
		public string SKU
		{
			set{ _sku=value;}
			get{return _sku;}
		}
		/// <summary>
		/// 
		/// </summary>
		public decimal? Weight
		{
			set{ _weight=value;}
			get{return _weight;}
		}
		/// <summary>
		/// 
		/// </summary>
		public int Stock
		{
			set{ _stock=value;}
			get{return _stock;}
		}
		/// <summary>
		/// 
		/// </summary>
		public decimal? CostPrice
		{
			set{ _costprice=value;}
			get{return _costprice;}
		}
		/// <summary>
		/// 
		/// </summary>
		public decimal SalePrice
		{
			set{ _saleprice=value;}
			get{return _saleprice;}
		}
		#endregion Model


        private Dictionary<int, decimal> memberPrices;
        private Dictionary<int, int> skuItems;

        public int CompareTo(object obj)
        {
            Hishop_SKUs item = obj as Hishop_SKUs;
            if (item == null)
            {
                return -1;
            }
            if (item.SkuItems.Count != this.SkuItems.Count)
            {
                return -1;
            }
            foreach (int num in item.SkuItems.Keys)
            {
                if (item.SkuItems[num] != this.SkuItems[num])
                {
                    return -1;
                }
            }
            return 0;
        }

        public Dictionary<int, decimal> MemberPrices
        {
            get
            {
                return (this.memberPrices ?? (this.memberPrices = new Dictionary<int, decimal>()));
            }
        }

        public Dictionary<int, int> SkuItems
        {
            get
            {
                return (this.skuItems ?? (this.skuItems = new Dictionary<int, int>()));
            }
        }
	}
}

